//
//  BigNumButtonStyle.swift
//  Maze24
//
//  Created by Mars on 2020/11/6.
//

import SwiftUI

struct BigNumButtonStyle: ButtonStyle {
  let cornerRadius: CGFloat
  let corners:  UIRectCorner
  
  func makeBody(configuration: Configuration) -> some View {
    RoundedCorners(cornerRadius: cornerRadius, corners: corners)
      .fill(Color.purple.opacity(configuration.isPressed ? 0.8 : 1))
      .overlay(
        configuration.label
          .foregroundColor(.white)
          .font(Font.system(size: 66).weight(.semibold))
          .padding()
          .lineLimit(1)
          .minimumScaleFactor(0.5)
      )
  }
}

struct OpButtonStyle: ButtonStyle {
  func makeBody(configuration: Configuration) -> some View {
    configuration.label
      .font(Font.system(size: 36).weight(.semibold))
      .foregroundColor(configuration.isPressed ? .secondary : .primary)
      .padding()
  }
}
